<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>载入图片并且设置属性</title>
    <script src="../EaselJS/lib/easeljs-0.8.2.min.js"></script>
</head>
<body onload="init();">
    <canvas id="demoCanvas" width="800" height="300"></canvas>
    <script>
        function init() {
            var canvas = document.getElementById("demoCanvas");
            var stage = new createjs.Stage(canvas);
            //获取图片
            var img = new Image();
            img.src = "http://dev.shebao.haodai.net/public/img/banner_index.png";
            img.onload = function () {
                for(var i = 0;i<50;i++){
                    var tempBitMap = new createjs.Bitmap(img);
                    stage.addChild(tempBitMap);
                    tempBitMap.x = Math.floor(Math.random()*500);
                    tempBitMap.y = Math.floor(Math.random()*100);
                    tempBitMap.rotation = Math.floor(Math.random() * 360);
                    tempBitMap.shadow = new createjs.Shadow('#000',10,10,10)
                }
                stage.update();
            };
        }
    </script>
</body>
</html>